package com.tuju.jetpackfirstdemo.ui.recordings;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import com.tuju.jetpackfirstdemo.R;
import com.tuju.jetpackfirstdemo.widget.WaveView;

public class RecordingActivity extends AppCompatActivity {

    private WaveView wv_progress;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
        setContentView(R.layout.activity_recording);
//        wv_progress = findViewById(R.id.wv_progress);
//        wv_progress.postDelayed(new Runnable() {
//            @Override
//            public void run() {
//                changeProgress();
//            }
//        }, 2000);
        Toast.makeText(this,"1111",Toast.LENGTH_LONG).show();
    }

    private void changeProgress(){
        wv_progress.setFlowNum(50);
    }

    public void payComple(View view) {
        final AlertDialog.Builder builder = new AlertDialog.Builder(this);
        View dialogView = LayoutInflater.from(this).inflate(R.layout.dialog_pay_comple, null);
        dialogView.findViewById(R.id.btn_sure).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                builder.create().dismiss();
                Toast.makeText(RecordingActivity.this, "支付成功！", Toast.LENGTH_SHORT).show();
            }
        });
        dialogView.findViewById(R.id.btn_cancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                builder.create().dismiss();
            }
        });
        builder.setView(dialogView);
        builder.show();
    }

    public void paySuccess(View view) {

    }


}
